package Controllers;

import DAO.PriceList_Dao;

public class PriceList_Validator {

    public PriceList_Validator() {
    }

    public PriceList_Validator(PriceList_Dao priceList_Dao) {
    }

    public boolean validatePriceList(String fmpoukali, String fpoto, String fmpyra, String fsfinaki, String fmiso, String kmpoukali, String kpoto, String kmpyra, String ksfinaki, String kmiso) {
        boolean x = true;

        if (fmpoukali.isEmpty() || fpoto.isEmpty() || fmpyra.isEmpty() || fsfinaki.isEmpty() || fmiso.isEmpty() || kmpoukali.isEmpty() || kpoto.isEmpty() || kmpyra.isEmpty() || ksfinaki.isEmpty() || kmiso.isEmpty()) {
            x = false;
        } else if (fmpoukali.matches("[0-9]+") == false || fpoto.matches("[0-9]+") == false || fmpyra.matches("[0-9]+") == false || fsfinaki.matches("[0-9]+") == false || fmiso.matches("[0-9]+") == false || kmpoukali.matches("[0-9]+") == false || kpoto.matches("[0-9]+") == false || kmpyra.matches("[0-9]+") == false || ksfinaki.matches("[0-9]+") == false || kmiso.matches("[0-9]+") == false) {
            x = false;
        } else if (fmpoukali.length() > 2 || kmpoukali.length() > 3 || fpoto.length() > 1 || kpoto.length() > 2 || fmpyra.length() > 1 || kmpyra.length() > 1 || fsfinaki.length() > 1 || ksfinaki.length() > 1) {
            x = false;
        }
        return x;
    }
}
